package com.lo23.data.objpicture;

import java.util.Date;

import com.lo23.data.utils.DataUtils;
import com.lo23.data.utils.FormatConvert;
import com.lo23.data.xml.XMLData;

public class Comment {

	XMLData.XMLPicture.XMLCommentItems _comment;

	public Comment(XMLData.XMLPicture.XMLCommentItems comment) {

		this._comment = comment;
	}

	/**
	 * Get the content of the comment
	 * @return the content
	 */
	public String getContent() {
		return DataUtils.nullString(_comment.getContent());
	}

	/**
	 * Get the date 
	 * @return the date
	 */
	public Date getDate() {
		return FormatConvert.xMLGregorianCalendarToDate(_comment.getDate());
	}

	/**
	 * Get the ID of the author
	 * @return the author ID
	 */
	public String getAuthorID() {
		return DataUtils.nullString(_comment.getAuthor());
	}

	/**
	 * Get the ID of the comment
	 * @return the comment ID
	 */
	public String getCID() {
		return DataUtils.nullString(_comment.getCID());
	}

	/**
	 * Set the content of the comment
	 * @param content
	 *            the content to set
	 */
	public void setContent(String content) {
		_comment.setContent(content);
	}

	/**
	 * Set the date
	 * @param date
	 *            the date to set
	 */
	public void setDate(Date date) {
		_comment.setDate(FormatConvert.dateToXMLGregorianCalendar(date));
	}

	/**
	 * Set the ID of the author of the comment
	 * @param author
	 *            the author ID to set
	 */
	public void setAuthorID(String author) {
		_comment.setAuthor(author);
	}

}
